package com.dzsw.dp.corp.chain;

import com.dzsw.dp.corp.chain.general.DemoChain;
import com.dzsw.dp.corp.chain.handler.DemoRequest;
import com.dzsw.dp.corp.chain.handler.dbtest.DbTestHandler;
import com.dzsw.dp.corp.chain.handler.logtest.LogTestHandler;
import com.dzsw.dp.corp.chain.handler.transtest.TransTestHandler;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.config.Configurator;

public class ChainMain {

    private static Logger log = LogManager.getLogger(ChainMain.class);

    public static void main(String[] args) {
        Configurator.initialize("Main", ChainMain.class.getClassLoader(), "classpath:log4j2.xml");
        log.info("ChainMain start");
        test0();

    }

    private static void test0() {
        DemoChain chain = new DemoChain(new TransTestHandler(), new LogTestHandler(), new DbTestHandler());
        DemoRequest request = new DemoRequest();
        chain.requestChain(request, null);
    }
}
